﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dos.ORM;

namespace Finance.Poco
{
    /// <summary>
    /// 实体类BankCardBin 。(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    public class BankCardBin : Entity
    {
        public BankCardBin() : base("bank_card_bin") { }

        #region Model
        private int _Id;
        private string _CardBin;
        private string _BankName;
        private int? _BankId;
        private string _CardName;
        private string _CardType;
        private int? _BinDigits;
        private int? _CardDigits;
        private string _Demo;
        /// <summary>
        /// auto_increment
        /// </summary>
        public int Id
        {
            get { return _Id; }
            set
            {
                this.OnPropertyValueChange(_.Id, _Id, value);
                this._Id = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string CardBin
        {
            get { return _CardBin; }
            set
            {
                this.OnPropertyValueChange(_.CardBin, _CardBin, value);
                this._CardBin = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string BankName
        {
            get { return _BankName; }
            set
            {
                this.OnPropertyValueChange(_.BankName, _BankName, value);
                this._BankName = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public int? BankId
        {
            get { return _BankId; }
            set
            {
                this.OnPropertyValueChange(_.BankId, _BankId, value);
                this._BankId = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string CardName
        {
            get { return _CardName; }
            set
            {
                this.OnPropertyValueChange(_.CardName, _CardName, value);
                this._CardName = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string CardType
        {
            get { return _CardType; }
            set
            {
                this.OnPropertyValueChange(_.CardType, _CardType, value);
                this._CardType = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public int? BinDigits
        {
            get { return _BinDigits; }
            set
            {
                this.OnPropertyValueChange(_.BinDigits, _BinDigits, value);
                this._BinDigits = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public int? CardDigits
        {
            get { return _CardDigits; }
            set
            {
                this.OnPropertyValueChange(_.CardDigits, _CardDigits, value);
                this._CardDigits = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Demo
        {
            get { return _Demo; }
            set
            {
                this.OnPropertyValueChange(_.Demo, _Demo, value);
                this._Demo = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        public override Field GetIdentityField()
        {
            return _.Id;
        }
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
				_.Id};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
				_.Id,
				_.CardBin,
				_.BankName,
				_.BankId,
				_.CardName,
				_.CardType,
				_.BinDigits,
				_.CardDigits,
				_.Demo};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
				this._Id,
				this._CardBin,
				this._BankName,
				this._BankId,
				this._CardName,
				this._CardType,
				this._BinDigits,
				this._CardDigits,
				this._Demo};
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(IDataReader reader)
        {
            this._Id = DataUtils.ConvertValue<int>(reader["id"]);
            this._CardBin = DataUtils.ConvertValue<string>(reader["cardBin"]);
            this._BankName = DataUtils.ConvertValue<string>(reader["bankName"]);
            this._BankId = DataUtils.ConvertValue<int?>(reader["bankId"]);
            this._CardName = DataUtils.ConvertValue<string>(reader["cardName"]);
            this._CardType = DataUtils.ConvertValue<string>(reader["cardType"]);
            this._BinDigits = DataUtils.ConvertValue<int?>(reader["binDigits"]);
            this._CardDigits = DataUtils.ConvertValue<int?>(reader["cardDigits"]);
            this._Demo = DataUtils.ConvertValue<string>(reader["demo"]);
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(DataRow row)
        {
            this._Id = DataUtils.ConvertValue<int>(row["id"]);
            this._CardBin = DataUtils.ConvertValue<string>(row["cardBin"]);
            this._BankName = DataUtils.ConvertValue<string>(row["bankName"]);
            this._BankId = DataUtils.ConvertValue<int?>(row["bankId"]);
            this._CardName = DataUtils.ConvertValue<string>(row["cardName"]);
            this._CardType = DataUtils.ConvertValue<string>(row["cardType"]);
            this._BinDigits = DataUtils.ConvertValue<int?>(row["binDigits"]);
            this._CardDigits = DataUtils.ConvertValue<int?>(row["cardDigits"]);
            this._Demo = DataUtils.ConvertValue<string>(row["demo"]);
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "bank_card_bin");
            /// <summary>
            /// auto_increment
            /// </summary>
            public readonly static Field Id = new Field("id", "bank_card_bin", "auto_increment");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CardBin = new Field("cardBin", "bank_card_bin", "cardBin");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field BankName = new Field("bankName", "bank_card_bin", "bankName");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field BankId = new Field("bankId", "bank_card_bin", "bankId");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CardName = new Field("cardName", "bank_card_bin", "cardName");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CardType = new Field("cardType", "bank_card_bin", "cardType");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field BinDigits = new Field("binDigits", "bank_card_bin", "binDigits");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CardDigits = new Field("cardDigits", "bank_card_bin", "cardDigits");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field Demo = new Field("demo", "bank_card_bin", "demo");
        }
        #endregion


    }

}
